package com.wonders.frame.chron.dao.summary;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.wonders.frame.chron.model.bo.Card;
import com.wonders.frame.chron.model.bo.Summary;
import com.wonders.frame.core.dao.GenericRepository;

public interface SummaryDao extends GenericRepository<Summary, Integer>{
	@Query("select a from Summary a where a.removed = 0 and a.id =?")
	public List<Card> findByCardNo(Integer id);
	
	@Transactional  
	@Modifying 
	@Query("update Summary a set a.todoItemId=?,a.processInstanceId=?,a.processDefinitionId=?,a.status=? where a.removed = 0 and a.id =?")
	public Integer updateSummaryById(String todoItemId,String processInstanceId,String processDefinitionId,String status,Integer id);
	
	@Transactional  
	@Modifying 
	@Query("update Summary a set a.todoItemId=?,a.status=? where a.removed = 0 and a.id =?")
	public Integer updateSummaryById(String todoItemId,String status,Integer id);
	
	
	@Transactional  
	@Modifying 
	@Query("update Summary a set  a.complieStatus=? where a.removed = 0 and a.id =?")
	public Integer updateSummaryComplieById( String complieStatus,Integer id);
	
	
	
}
